package com.css.zfzx.data.primary.HddcActivefaultPG.controller;

import com.css.zfzx.data.primary.HddcActivefaultPG.service.HddcActivefaultPGService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zyb
 * @date 2020-11-30
 */
@Slf4j
@RestController
@Transactional
@RequestMapping("/data/hddc/hddcActivefaultPG")
public class HddcActivefaultPGController {
    @Autowired
    private HddcActivefaultPGService hddcActivefaultPGService;

    /**
     * 迁移新建的数据不包含修改的
     */
    @Scheduled(cron = "${schedule.cron}")
    @GetMapping("/getData")
    public void newData(){
        System.out.println("hddc_activefault开始解析createTime");
        hddcActivefaultPGService.findDataCreate();
    }

    /**
     * 迁移修改的数据包含删除的
     */
    @Scheduled(cron = "${schedule.cron}")
    @GetMapping("/getUpdateData")
    public void updateData(){
        System.out.println("hddc_activefault开始解析updateTime");
        hddcActivefaultPGService.findDataUpdate();
    }
}